package com.example.jwt.service;

import com.example.jwt.dao.UserInfoDao;
import com.example.jwt.entity.UserInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;

import javax.persistence.GeneratedValue;

@Service
public class UserInfoService implements UserDetailsService {

    @Autowired
    UserInfoDao userInfoDao;

    @Override
    public UserDetails loadUserByUsername(String s) throws UsernameNotFoundException {
        return userInfoDao.findByUsername(s);
    }

}
